package com.my.lab.activity;

import com.my.lab.R;

import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.util.Log;
import android.view.MotionEvent;
import android.view.View;
import android.view.WindowManager;
import android.widget.ImageView;
import android.widget.Toast;

public class FloatWindowActivity  extends Activity{
    	
    	private Context mContext = null;
    	@Override
    	protected void onCreate(Bundle savedInstanceState) {
    	    super.onCreate(savedInstanceState);
    	    setContentView(R.layout.float_window);
    	    mContext = this;
    	    ImageView img = new ImageView(this);
    	    img.setBackgroundResource(R.drawable.new_sms_button_bg_a);
    	    img.setOnTouchListener(new View.OnTouchListener() {
	        
	        @Override
	        public boolean onTouch(View v, MotionEvent event) {
	            	Log.d("", "onTouch....");
	            	Toast.makeText(mContext, "test!!!!", Toast.LENGTH_SHORT).show();
	    		return false;
	        }
	    });
    	    WindowManager wm = (WindowManager)getApplicationContext().getSystemService("window");
    	    WindowManager.LayoutParams wl = new WindowManager.LayoutParams();
    	    
    	    wl.type = 2003;
    	    wl.format = 1;
    	    wl.flags = 40;
    	    wl.width = 40;
    	    wl.height = 40;
    	    
    	    wm.addView(img, wl);
    	    
    	}
}
